import 'package:flutter/material.dart';

class FilterBarItem extends StatelessWidget {
  final String title;
  final bool isActive;
  final Function(BuildContext)? onTap;

  const FilterBarItem({
    Key? key,
    required this.title,
    this.isActive = false,
    this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () => onTap!(context),
      behavior: HitTestBehavior.translucent,
      child: Container(
        alignment: Alignment.center,
        child: Row(
          children: [
            Text(
              title,
              style: TextStyle(
                fontSize: 14.0,
                color:
                    isActive ? Theme.of(context).primaryColor : Colors.black54,
              ),
            ),
            Icon(
              isActive
                  ? Icons.arrow_drop_up_rounded
                  : Icons.arrow_drop_down_rounded,
              color: isActive ? Theme.of(context).primaryColor : Colors.black54,
            ),
          ],
        ),
      ),
    );
  }
}
